package com.appspot.seqpop.meta;

//@javax.annotation.Generated(value = { "slim3-gen", "@VERSION@" }, date = "2011-01-23 14:11:23")
/** */
public final class ResultMeta extends org.slim3.datastore.ModelMeta<com.appspot.seqpop.model.Result> {

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, java.lang.Double> fuAndLiDStar = new org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, java.lang.Double>(this, "fuAndLiDStar", "fuAndLiDStar", java.lang.Double.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, java.lang.Double> fuAndLiFStar = new org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, java.lang.Double>(this, "fuAndLiFStar", "fuAndLiFStar", java.lang.Double.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, com.google.appengine.api.datastore.Key> key = new org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, com.google.appengine.api.datastore.Key>(this, "__key__", "key", com.google.appengine.api.datastore.Key.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, java.lang.Double> nucleotideDifferences = new org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, java.lang.Double>(this, "nucleotideDifferences", "nucleotideDifferences", java.lang.Double.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, java.lang.Integer> segregatingSites = new org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, java.lang.Integer>(this, "segregatingSites", "segregatingSites", java.lang.Integer.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, java.lang.Double> tajimaD = new org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, java.lang.Double>(this, "tajimaD", "tajimaD", java.lang.Double.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, java.lang.Long> version = new org.slim3.datastore.CoreAttributeMeta<com.appspot.seqpop.model.Result, java.lang.Long>(this, "version", "version", java.lang.Long.class);

    private static final ResultMeta slim3_singleton = new ResultMeta();

    /**
     * @return the singleton
     */
    public static ResultMeta get() {
       return slim3_singleton;
    }

    /** */
    public ResultMeta() {
        super("Result", com.appspot.seqpop.model.Result.class);
    }

    @Override
    public com.appspot.seqpop.model.Result entityToModel(com.google.appengine.api.datastore.Entity entity) {
        com.appspot.seqpop.model.Result model = new com.appspot.seqpop.model.Result();
        model.setFuAndLiDStar((java.lang.Double) entity.getProperty("fuAndLiDStar"));
        model.setFuAndLiFStar((java.lang.Double) entity.getProperty("fuAndLiFStar"));
        model.setKey(entity.getKey());
        model.setNucleotideDifferences((java.lang.Double) entity.getProperty("nucleotideDifferences"));
        model.setSegregatingSites(longToInteger((java.lang.Long) entity.getProperty("segregatingSites")));
        model.setTajimaD((java.lang.Double) entity.getProperty("tajimaD"));
        model.setVersion((java.lang.Long) entity.getProperty("version"));
        return model;
    }

    @Override
    public com.google.appengine.api.datastore.Entity modelToEntity(java.lang.Object model) {
        com.appspot.seqpop.model.Result m = (com.appspot.seqpop.model.Result) model;
        com.google.appengine.api.datastore.Entity entity = null;
        if (m.getKey() != null) {
            entity = new com.google.appengine.api.datastore.Entity(m.getKey());
        } else {
            entity = new com.google.appengine.api.datastore.Entity(kind);
        }
        entity.setProperty("fuAndLiDStar", m.getFuAndLiDStar());
        entity.setProperty("fuAndLiFStar", m.getFuAndLiFStar());
        entity.setProperty("nucleotideDifferences", m.getNucleotideDifferences());
        entity.setProperty("segregatingSites", m.getSegregatingSites());
        entity.setProperty("tajimaD", m.getTajimaD());
        entity.setProperty("version", m.getVersion());
        entity.setProperty("slim3.schemaVersion", 1);
        return entity;
    }

    @Override
    protected com.google.appengine.api.datastore.Key getKey(Object model) {
        com.appspot.seqpop.model.Result m = (com.appspot.seqpop.model.Result) model;
        return m.getKey();
    }

    @Override
    protected void setKey(Object model, com.google.appengine.api.datastore.Key key) {
        validateKey(key);
        com.appspot.seqpop.model.Result m = (com.appspot.seqpop.model.Result) model;
        m.setKey(key);
    }

    @Override
    protected long getVersion(Object model) {
        com.appspot.seqpop.model.Result m = (com.appspot.seqpop.model.Result) model;
        return m.getVersion() != null ? m.getVersion().longValue() : 0L;
    }

    @Override
    protected void assignKeyToModelRefIfNecessary(com.google.appengine.api.datastore.AsyncDatastoreService ds, java.lang.Object model) {
    }

    @Override
    protected void incrementVersion(Object model) {
        com.appspot.seqpop.model.Result m = (com.appspot.seqpop.model.Result) model;
        long version = m.getVersion() != null ? m.getVersion().longValue() : 0L;
        m.setVersion(Long.valueOf(version + 1L));
    }

    @Override
    protected void prePut(Object model) {
    }

    @Override
    public String getSchemaVersionName() {
        return "slim3.schemaVersion";
    }

    @Override
    public String getClassHierarchyListName() {
        return "slim3.classHierarchyList";
    }

    @Override
    protected boolean isCipherProperty(String propertyName) {
        return false;
    }

    @Override
    protected void modelToJson(org.slim3.datastore.json.JsonWriter writer, java.lang.Object model, int maxDepth, int currentDepth) {
        com.appspot.seqpop.model.Result m = (com.appspot.seqpop.model.Result) model;
        writer.beginObject();
        org.slim3.datastore.json.JsonCoder encoder = null;
        if(m.getFuAndLiDStar() != null){
            writer.setNextPropertyName("fuAndLiDStar");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getFuAndLiDStar());
        }
        if(m.getFuAndLiFStar() != null){
            writer.setNextPropertyName("fuAndLiFStar");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getFuAndLiFStar());
        }
        if(m.getKey() != null){
            writer.setNextPropertyName("key");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getKey());
        }
        if(m.getNucleotideDifferences() != null){
            writer.setNextPropertyName("nucleotideDifferences");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getNucleotideDifferences());
        }
        if(m.getSegregatingSites() != null){
            writer.setNextPropertyName("segregatingSites");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getSegregatingSites());
        }
        if(m.getTajimaD() != null){
            writer.setNextPropertyName("tajimaD");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getTajimaD());
        }
        if(m.getVersion() != null){
            writer.setNextPropertyName("version");
            encoder = new org.slim3.datastore.json.Default();
            encoder.encode(writer, m.getVersion());
        }
        writer.endObject();
    }

    @Override
    public com.appspot.seqpop.model.Result jsonToModel(org.slim3.datastore.json.JsonRootReader rootReader, int maxDepth, int currentDepth) {
        com.appspot.seqpop.model.Result m = new com.appspot.seqpop.model.Result();
        org.slim3.datastore.json.JsonReader reader = null;
        org.slim3.datastore.json.JsonCoder decoder = null;
        reader = rootReader.newObjectReader("fuAndLiDStar");
        decoder = new org.slim3.datastore.json.Default();
        m.setFuAndLiDStar(decoder.decode(reader, m.getFuAndLiDStar()));
        reader = rootReader.newObjectReader("fuAndLiFStar");
        decoder = new org.slim3.datastore.json.Default();
        m.setFuAndLiFStar(decoder.decode(reader, m.getFuAndLiFStar()));
        reader = rootReader.newObjectReader("key");
        decoder = new org.slim3.datastore.json.Default();
        m.setKey(decoder.decode(reader, m.getKey()));
        reader = rootReader.newObjectReader("nucleotideDifferences");
        decoder = new org.slim3.datastore.json.Default();
        m.setNucleotideDifferences(decoder.decode(reader, m.getNucleotideDifferences()));
        reader = rootReader.newObjectReader("segregatingSites");
        decoder = new org.slim3.datastore.json.Default();
        m.setSegregatingSites(decoder.decode(reader, m.getSegregatingSites()));
        reader = rootReader.newObjectReader("tajimaD");
        decoder = new org.slim3.datastore.json.Default();
        m.setTajimaD(decoder.decode(reader, m.getTajimaD()));
        reader = rootReader.newObjectReader("version");
        decoder = new org.slim3.datastore.json.Default();
        m.setVersion(decoder.decode(reader, m.getVersion()));
    return m;
}
}